﻿using Learun.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Windows.Documents;

namespace Learun.Application.TwoDevelopment.ZZDT_EC

{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-06-21 15:32
    /// 描 述：接线模块 - panel柜子
    /// </summary>
    [SugarTable(TableName = "ec_OPC")]
    public class ec_OPCEntity
    {
        #region 实体成员
        /// <summary>
        /// ID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string OPCID { get; set; }

        /// <summary>
        /// 1端
        /// </summary>
        public string ID1 { get; set; } = "1";

        /// <summary>
        /// 2端
        /// </summary>
        public string ID2 { get; set; } = "2";

        /// <summary>
        /// 1端所在图纸
        /// </summary>
        public string DrawingFileID1 { get; set; }    
        
        /// <summary>
        /// 2端所在图纸
        /// </summary>
        public string DrawingFileID2 { get; set; }

        /// <summary>
        /// 1端的句柄(暂时不用，句柄依旧存储在表<see cref="ec_enginedata_pixelEntity"/>中)
        /// </summary>
        public string PixelCode1 { get; set; }

        /// <summary>
        /// 2端的句柄
        /// </summary>
        public string PixelCode2 { get; set; }


        /// <summary>
        /// 描述
        /// </summary>
        public string TOTEXT { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string FROMTEXT { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string DESC { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string OPCTAG { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.OPCID = Guid.NewGuid().ToString();
            this.ID1 = "1";
            this.ID2 = "2";
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;
        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.OPCID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段

        #endregion
    }
}

